from mediator import mediator
from mediator . tests . test_assistant import make_mediator_test_keyword_args

class main_loop_fake :
    def __init__ ( self ) :
        self . _enter_main_loop = None
    def enter_main_loop ( self , application_window ) :
        self . _enter_main_loop = application_window
        
class mediator_main_loop_tests : 
    'mediator_main_loop'
    def __init__ ( self , test ) :
        self . _test = test
        self . _main_loop = main_loop_fake ( )
        self . _mediator = mediator ( )
        self . _mediator . register_modules ( ** make_mediator_test_keyword_args \
            ( 'main_loop' 
            , self . _main_loop 
            , None
            ) )
    def test_enter_main_loop ( self ) :
        self . _mediator . enter_main_loop ( 'my window' )
        self . _test . assume_equal ( self . _main_loop . _enter_main_loop , 'my window' )
